#ifndef _GLOBALDEFMANAGER_H_
#define _GLOBALDEFMANAGER_H_
#include "gDefine.h"
#include "GlobalClassManager.h"

class DefMangerBase;
class GlobalDefManager
{
public:
	static  GlobalDefManager& Instance()
	{
		static GlobalDefManager _instance;
		return _instance;
	}
	bool RegisterDefManger(DefMangerBase* pManager);

	DefMangerBase* LookupDefManager(int32 iGroup,int32 iSubID);
	DefMangerBase* LookupDefManager(int32 iID);
	void ReadFromArchieves();
	void WirteToArchieves();
	void EnumerateDefManagers(std::vector<DefMangerBase*>& vManagers);
	void UpdateReference();
	void Release();
private:
	GlobalDefManager(){}
	
	std::map<int32,DefMangerBase*> m_mDefManagers;
};


#endif //_GLOBALDEFMANAGER_H_